//
//  MainController.swift
//  ExpressManager
//
//  Created by yongkang on 2017/11/3.
//  Copyright © 2017年 sheng. All rights reserved.
//

import UIKit
import SnapKit

class MainController: UIViewController {
    
    @IBOutlet weak var logoImg: UIImageView!
    
    @IBOutlet weak var companyInfo: UILabel!
    
    @IBOutlet weak var orderImage: UIImageView!
    
    @IBOutlet weak var orderLabel: UILabel!
    
    @IBOutlet weak var chartImage: UIImageView!
    
    @IBOutlet weak var chartLabel: UILabel!
    
    @IBOutlet weak var trackImage: UIImageView!
    
    @IBOutlet weak var trackLabel: UILabel!
    
    @IBOutlet weak var historyImage: UIImageView!
    
    @IBOutlet weak var historyLabel: UILabel!
    
    @IBOutlet weak var line: UIView!
    var scrrenWidth = UIScreen.main.bounds.width
    

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.logoImg.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(self.view.snp.top).offset(120)
            make.centerX.equalTo(self.view)
            make.height.equalTo(80)
            make.width.equalTo(80)
        }
        
        self.companyInfo.numberOfLines = 0
        self.companyInfo.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(self.logoImg.snp.bottom).offset(5)
            make.width.lessThanOrEqualTo(self.view).offset(-50)
            make.centerX.equalTo(self.logoImg.snp.centerX)
        }
        
        self.line.backgroundColor = UIColor.lightGray
        self.line.snp.makeConstraints { (make) -> Void in
            make.height.equalTo(0.5)
            make.left.equalTo(15)
            make.right.equalTo(-15)
            make.top.equalTo(self.companyInfo.snp.bottom).offset(20)
        }
        
        self.orderImage.snp.makeConstraints { (make) -> Void in
            make.height.equalTo(40)
            make.width.equalTo(40)
            make.top.equalTo(self.line.snp.bottom).offset(25)
            make.left.equalTo((scrrenWidth/2 - 40)/2)
        }
        
        self.orderLabel.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(self.orderImage.snp.bottom).offset(2)
            make.centerX.equalTo(self.orderImage.snp.centerX)
        }
        
        self.chartImage.snp.makeConstraints { (make) -> Void in
            make.height.equalTo(40)
            make.width.equalTo(40)
            make.top.equalTo(self.line.snp.bottom).offset(25)
            make.right.equalTo(-(scrrenWidth/2 - 40)/2)
        }
        
        self.chartLabel.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(self.chartImage.snp.bottom).offset(2)
            make.centerX.equalTo(self.chartImage.snp.centerX)
        }

        self.trackImage.snp.makeConstraints { (make) -> Void in
            make.height.equalTo(40)
            make.width.equalTo(40)
            make.top.equalTo(self.orderLabel.snp.bottom).offset(25)
            make.left.equalTo((scrrenWidth/2 - 40)/2)
        }
        
        self.trackLabel.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(self.trackImage.snp.bottom).offset(2)
            make.centerX.equalTo(self.trackImage.snp.centerX)
        }
        
        self.historyImage.snp.makeConstraints { (make) -> Void in
            make.height.equalTo(40)
            make.width.equalTo(40)
            make.top.equalTo(self.chartLabel.snp.bottom).offset(25)
            make.right.equalTo(-(scrrenWidth/2 - 40)/2)
        }
        
        self.historyLabel.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(self.historyImage.snp.bottom).offset(2)
            make.centerX.equalTo(self.historyImage.snp.centerX)
        }
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()

    }
    

    

}
